<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>会员详情</title>
    <link rel="stylesheet" href="/app/admin/component/layui/css/layui.css">
    <style>
        .form-content {
            padding: 20px;
        }
        .detail-item {
            margin-bottom: 15px;
        }
        .detail-label {
            font-weight: bold;
            display: inline-block;
            width: 100px;
        }
    </style>
</head>
<body>
<div class="form-content">
    <div class="detail-item">
        <span class="detail-label">会员卡号：</span>
        <span><?= $member->card_no ?></span>
    </div>
    <div class="detail-item">
        <span class="detail-label">会员姓名：</span>
        <span><?= $member->name ?></span>
    </div>
    <div class="detail-item">
        <span class="detail-label">手机号码：</span>
        <span><?= $member->phone ?></span>
    </div>
    <div class="detail-item">
        <span class="detail-label">会员等级：</span>
        <span><?= $member->level_name ?></span>
    </div>
    <div class="detail-item">
        <span class="detail-label">会员状态：</span>
        <span><?php 
            switch($member->status) {
                case 1:
                    echo '<span class="layui-badge layui-bg-green">正常</span>';
                    break;
                case 2:
                    echo '<span class="layui-badge layui-bg-orange">冻结</span>';
                    break;
                case 3:
                    echo '<span class="layui-badge">注销</span>';
                    break;
                default:
                    echo '<span class="layui-badge layui-bg-gray">未知</span>';
            }
        ?></span>
    </div>
    <div class="detail-item">
        <span class="detail-label">所属门店：</span>
        <span><?= $member->store_name ?></span>
    </div>
    <div class="detail-item">
        <span class="detail-label">余额：</span>
        <span><?= $member->balance ?></span>
    </div>
    <div class="detail-item">
        <span class="detail-label">积分：</span>
        <span><?= $member->points ?></span>
    </div>
    <div class="detail-item">
        <span class="detail-label">生日：</span>
        <span><?= $member->birthday ?: '-' ?></span>
    </div>
    <div class="detail-item">
        <span class="detail-label">地址：</span>
        <span><?= $member->address ?: '-' ?></span>
    </div>
    <div class="detail-item">
        <span class="detail-label">备注：</span>
        <span><?= $member->remark ?: '-' ?></span>
    </div>
    <div class="detail-item">
        <span class="detail-label">创建时间：</span>
        <span><?= $member->created_at ?></span>
    </div>
    
    <div class="layui-form-item" style="margin-top: 20px;">
        <div class="layui-input-block">
            <button class="layui-btn" onclick="editMember(<?= $member->id ?>)">编辑</button>
            <button type="button" class="layui-btn layui-btn-primary" onclick="closeLayer()">关闭</button>
        </div>
    </div>
</div>

<script src="/app/admin/component/layui/layui.js"></script>
<script>
layui.use(['layer'], function(){
    var $ = layui.$;
    window.closeLayer = function(){
        var index = parent.layer.getFrameIndex(window.name);
        parent.layer.close(index);
    }
    
    window.editMember = function(id){
        parent.layer.open({
            type: 2,
            title: '编辑会员',
            area: ['800px', '600px'],
            content: '/app/ky_shouyin/admin/member/edit?id=' + id
        });
    }
});
</script>
</body>
</html> 